x86: Clean ups and fixes after bitops changes.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 18 Mar 2008 10:51:20 +0000 (10:51 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 18 Mar 2008 10:51:20 +0000 (10:51 +0000)
Firstly, the vlapic bitops need fewer casts.

Secondly, the minimum-alignment check is unnecessary and also breaks
the build (page_info's type_info field has alignment == 1). It is an
unnecessary check because bitops operate on only one bit of the word
they access, so lack of atomicity of the read and writeback does not
matter -- furthermore the LOCKed variants are guaranteed atomic
regardless of alignment.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/hvm/vlapic.c
xen/include/asm-x86/bitops.h

index 071f9b3c5076532ac3e68d6f253ea2ea39576233..bf53ba7a1ac6f17467901b9027cc94bfe1301ac4 100644 (file)
@@ -114,14 +114,12 @@ static int vlapic_find_highest_vector(void *bitmap)
 
 static int vlapic_test_and_set_irr(int vector, struct vlapic *vlapic)
 {
-    return vlapic_test_and_set_vector(
-        vector, (unsigned long *)&vlapic->regs->data[APIC_IRR]);
+    return vlapic_test_and_set_vector(vector, &vlapic->regs->data[APIC_IRR]);
 }
 
 static void vlapic_clear_irr(int vector, struct vlapic *vlapic)
 {
-    vlapic_clear_vector(
-        vector, (unsigned long *)&vlapic->regs->data[APIC_IRR]);
+    vlapic_clear_vector(vector, &vlapic->regs->data[APIC_IRR]);
 }
 
 static int vlapic_find_highest_irr(struct vlapic *vlapic)
index fd90c50355bdc20b21e3c775ed3ee61da724d388..5143bb525bc1bf7e86c02a8946b9652d9423d4f0 100644 (file)
@@ -26,7 +26,7 @@
 #define CONST_ADDR (*(const volatile long *) addr)
 
 extern void __bitop_bad_size(void);
-#define bitop_bad_size(addr) (min(sizeof(*(addr)), __alignof__(*(addr))) < 4)
+#define bitop_bad_size(addr) (sizeof(*(addr)) < 4)
 
 /**
  * set_bit - Atomically set a bit in memory